function main(defaultParams) {
    const self = this;
    const TABLE_NAME = 't_2488d76f089b4f00aae44062307659fd';
    debugger
    if (defaultParams.moduleActionType === 'form-save') {
        const data = defaultParams.callbackParams.data['t_5a380704cc1c4f139e0c45b89a5ab317'];
        const managementResult = data.radio_gjlolp;
        const human_id = defaultParams.id.value;
        const preConversionDate = data.date_picker_66ezyj;

        let workStatusCode = '';
        let workStatusName = '';

        switch (managementResult) {
            case '1':
                workStatusCode = '1';
                workStatusName = '在职';
                break;
            case '2':
                workStatusCode = '8';
                workStatusName = '延期转正';
                break;
            case '3':
                workStatusCode = '9';
                workStatusName = '不予转正';
                break;
            default:
                console.warn('未知的管理结果:', managementResult);
                return;
        }

        const updateFields = [
            ['work_status_code', `'${workStatusCode}'`],
            ['work_status_name', `'${workStatusName}'`],
            ['Pre_conversion_date', `'${preConversionDate}'`]
        ];


        // 如果是“在职”，额外更新 become_regular_date 字段
        if (managementResult === '1') {
            updateFields.push(['become_regular_date', 'NOW()']);
        }

        const formattedFields = updateFields.map(([key, value]) => {
            return `'${key}',${value}`;
        });

        let updateSql = `UPDATE('${TABLE_NAME}', QUERY_EQ('id', '${human_id}'),'', [${formattedFields.join(',')}])`;

        console.log(updateSql);
        api.EXEC_FORMULA(updateSql)
            .then((res) => {
                if (res.result) {
                    console.log('更新成功');
                    updateList(self);
                }
            })
            .catch(err => {
                console.error('更新失败:', err);
            });
    }
}

function updateList(self) {
    const LIST_WIDGET_IDS = ['page_widget_list_e5n98u', 'page_widget_list_6o5iog', 'page_widget_list_h64y0p', 'page_widget_list_1xkcmp'];
    LIST_WIDGET_IDS.forEach(widgetId => {
        const pageListEle = self.$$(widgetId);
        const listRenderView = pageListEle.$$getRenderElement();
        const currentListEle = listRenderView.$$getListElement();
        currentListEle.$$refreshData();
    });
}
